home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindlink.net!news
- From: genew@mindlink.bc.ca (Gene Wirchenko)
- Newsgroups: comp.lang.c
- Subject: Re: Is this ok: *pointer++ = value ??
- Date: Sun, 07 Jan 1996 01:51:54 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Message-ID: <4cn97v$6on@fountain.mindlink.net>
- References: <4cklvv$nmm@alcor.usc.edu> <4cmmcd$e3u@gryphon.phoenix.net> <30eefb76.72646976@nntp.ix.netcom.com>
- NNTP-Posting-Host: line139.nwm.mindlink.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- miker3@ix.netcom.com (Mike Rubenstein) wrote:
-
- >brucew@phoenix.net (Bruce Wedding) wrote:
-
- >|>wawda@alcor.usc.edu (Abu Wawda) wrote:
- >|>
- >|>> for (i=0; i<50; i++) *pointer++ = i;
- >|>
- >|>>My only problem is why? I mean you aren't allowed to do:
- >|>
- >|>> for (i=0; i<50; i++) p++ = i;
- >|>
- >|>Sure you can do that. You are assigning addresses to the pointer.
- >It
- >|>probably isn't too smart, but it is legal.
-
- >In what language is it legal? Certainly not C which requires a
- >modifiable lvalue as the right operand of = and defines p++ as not
- >being an lvalue.
-
- >Michael M Rubenstein
-
- Bull! The RIGHT operand requires an L-value? Ha! That would
- make:
- int a;
- a=2;
- illegal.
- In the example above,
- p
- is the L-value. After being used as such, it is incremented.
-
- Sincerely,
-
- Gene Wirchenko
-
- C Pronunciation Guide:
- y=x++; "wye equals ex plus plus semicolon"
- x=x++; "ex equals ex doublecross semicolon"
-
-